package model.turtle;

import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import util.Pixmap;

/**
 * StampSegment takes care of stamping the Commandable image.
 *
 * @author Angelica Schwartz
 */
public class StampSegment extends PathSegment {

    /**
     * The image to stamp.
     */
    private Pixmap stamp;
    /**
     * the size of the image.
     */
    private Dimension mySize;
    /**
     * the center of the image.
     */
    private Point2D.Double myStartingPoint;
    /**
     * the angle of the image.
     */
    private double myAngle;
    /**
     * scale value for the angles so 0 degrees is to the right.
     */
    private static final int ANGLE_SCALE = 90;
    
    /**
     * Constructor.
     */
    public StampSegment(Pixmap image, Dimension size,
                        Point2D.Double start, double angle) {
        stamp = image;
        mySize = size;
        myStartingPoint = start;
        myAngle = angle + ANGLE_SCALE;
    }

    /**
     * method for painting the
     *      StampSegment.
     */
    @Override
    public void paint(Graphics2D pen) {
        stamp.paint(pen, myStartingPoint, mySize, myAngle);
    }
}
